$(function () {
    $("#jqGrid").jqGrid({
        url: baseURL + 'baseinfo/lhpinstallationpoint/getDataByUserId',
        datatype: "json",
        colModel: [			

			{ label: '安装点', name: 'pointName', index: 'pointName', width: 80 },
			{ label: '水膜高度(μm)', name: 'waterFilmHeight', index: 'waterFilmHeight', width: 80,cellattr:function(value, options, row){
			    return "style='background:"+row.waterFilmHeightLevel+"'"
                } },
			{ label: '路面状态', name: 'roadCondition', index: 'roadCondition', width: 80 ,cellattr:function(value, options, row){
                    return "style='background:"+row.roadConditionLevel+"'"
                }},
			{ label: '路面温度(℃)', name: 'roadSurfaceTemp', index: 'roadSurfaceTemp', width: 80,cellattr:function(value, options, row){
                    return "style='background:"+row.roadSurfaceTempLevel+"'"
                } },
			{ label: '湿滑系数', name: 'friction', index: 'friction', width: 80 ,cellattr:function(value, options, row){
                    return "style='background:"+row.frictionLevel+"'"
                }},
			{ label: '能见度(m)', name: 'visibility', index: 'visibility', width: 80 ,cellattr:function(value, options, row){
                    return "style='background:"+row.visibilityLevel+"'"
                }},
			{ label: '风速(m/s)', name: 'windSpeed', index: 'windSpeed', width: 80 },
			{ label: '相对湿度(%)', name: 'relativeHumidity', index: 'relativeHumidity', width: 80 },
			{ label: '气压(Pa)', name: 'pressure', index: 'pressure', width: 80 },
			{ label: '气温(℃)', name: 'ambientTemp', index: 'ambientTemp', width: 80 },
			{ label: '降水量(mm)', name: 'precipitation', index: 'precipitation', width: 80 },
			{ label: '降水强度(mm)', name: 'precipitationIntensity', index: 'precipitationIntensity', width: 80 },

        ],
		viewrecords: true,
        height: 615,
        autowidth:true,
        jsonReader : {
            root: "list"
        },

		/*rowNum: 10,
		rowList : [10,30,50],
		pager: "#jqGridPager",
		jsonReader : {
			root: "page.list",
			page: "page.currPage",
			total: "page.totalPage",
			records: "page.totalCount"
		},
		prmNames : {
			page:"page",
			rows:"limit",
			order: "order",
		},*/
        gridComplete:function(){
        	//隐藏grid底部滚动条
        	$("#jqGrid").closest(".ui-jqgrid-bdiv").css({ "overflow-x" : "hidden" }); 
        }
    });
});


var vm = new Vue({
	el:'#rrapp',
	data:{
        showList: true,
        title: null
	},
	methods: {
		query: function () {
			vm.reload();
		},
		reload: function (event) {
			vm.showList = true;
			var page = $("#jqGrid").jqGrid('getGridParam','page');
			$("#jqGrid").jqGrid('setGridParam',{
                postData:{'pointName': vm.q.pointName},
                page:page
            }).trigger("reloadGrid");
		}
	}
});